package com.fsp.blog.controller;

import com.fsp.blog.service.SysUserService;
import com.fsp.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author fushengping
 * @className UserController
 * @description
 * @date 2021/11/11 23:46
 */
@RestController
@RequestMapping("/users")
public class UserController {

    @Autowired
    private SysUserService sysUserService;

    @GetMapping("currentUser") //
    public Result currentUser(@RequestHeader("Authorization") String token) {
        return sysUserService.getUserInfoByToken(token);
    }
}
